# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataproc.V1.Model.GkeNodePoolConfig do
  @moduledoc """
  The configuration of a GKE node pool used by a Dataproc-on-GKE cluster (https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster).

  ## Attributes

  *   `autoscaling` (*type:* `GoogleApi.Dataproc.V1.Model.GkeNodePoolAutoscalingConfig.t`, *default:* `nil`) - Optional. The autoscaler configuration for this node pool. The autoscaler is enabled only when a valid configuration is present.
  *   `config` (*type:* `GoogleApi.Dataproc.V1.Model.GkeNodeConfig.t`, *default:* `nil`) - Optional. The node pool configuration.
  *   `locations` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The list of Compute Engine zones (https://cloud.google.com/compute/docs/zones#available) where node pool nodes associated with a Dataproc on GKE virtual cluster will be located.Note: All node pools associated with a virtual cluster must be located in the same region as the virtual cluster, and they must be located in the same zone within that region.If a location is not specified during node pool creation, Dataproc on GKE will choose the zone.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoscaling => GoogleApi.Dataproc.V1.Model.GkeNodePoolAutoscalingConfig.t() | nil,
          :config => GoogleApi.Dataproc.V1.Model.GkeNodeConfig.t() | nil,
          :locations => list(String.t()) | nil
        }

  field(:autoscaling, as: GoogleApi.Dataproc.V1.Model.GkeNodePoolAutoscalingConfig)
  field(:config, as: GoogleApi.Dataproc.V1.Model.GkeNodeConfig)
  field(:locations, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Dataproc.V1.Model.GkeNodePoolConfig do
  def decode(value, options) do
    GoogleApi.Dataproc.V1.Model.GkeNodePoolConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataproc.V1.Model.GkeNodePoolConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
